﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SuuntoWebsite.Events._201205
{
    public partial class Registration : System.Web.UI.Page
    {
        protected string rewrite = System.Configuration.ConfigurationManager.AppSettings["rewriteType"];
        protected string beginTimeStr = System.Configuration.ConfigurationManager.AppSettings["begintime"];
        protected string endTimeStr = System.Configuration.ConfigurationManager.AppSettings["endtime"];
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!CheckTime())
            {
                Response.Redirect("/ambit_preorder.html");
            }
        }
        protected bool CheckTime()
        {
            bool flag = false;
            DateTime nowTime = DateTime.Now;
            DateTime beginTime = Convert.ToDateTime(beginTimeStr);
            DateTime endTime = Convert.ToDateTime(endTimeStr);
            if(nowTime.CompareTo(beginTime)>0&&nowTime.CompareTo(endTime)<0)
            {
                flag = true;
            }
            return flag;
        }
    }
}
